home *** CD-ROM | disk | FTP | other *** search
- global gHoldList, gPiconList, gHoldAtt, gNewAttList
-
- on hGetNames aFirstPicon, aLastPicon
- set vL to "a"
- set vLUT to value(field ("LU_" & vL & "_ENCY"))
- repeat with n = aFirstPicon to aLastPicon
- set vName to the name of cast n
- if not (char 1 of vName = vL) then
- set vL to char 1 of vName
- set vLUT to value(field ("LU_" & vL & "_ENCY"))
- end if
- set vSN to char 1 to 6 of vName
- put getaProp(vLUT, vSN)
- end repeat
- end
-
- on hUpdateAttributesList pPiconBEGIN, pPiconsEND, pMode
- if voidp(pMode) then
- set pMode to #Renew
- end if
- set vBeginShortCastMem to the number of cast "LU_A_ENCY"
- set vEndShortCastMem to the number of cast "LU_Z_ENCY"
- set vEncyBeginCastMem to the number of cast "ATTRIB_A_ENCY"
- set vEncyEndCastMem to the number of cast "ATTRIB_Z_ENCY"
- set vEpisBeginCastMem to the number of cast "ATTRIB_A_EPIS"
- set vEpisEndCastMem to the number of cast "ATTRIB_Z_EPIS"
- set vChroBeginCastMem to the number of cast "ATTRIB_18_CHRO"
- set vChroEndCastMem to the number of cast "ATTRIB_24_CHRO"
- hMakeListFromCast(vBeginShortCastMem, vEndShortCastMem)
- hMakePiconList(pPiconBEGIN, pPiconsEND)
- repeat with vEncyBeginCastMem = vEncyBeginCastMem to vEncyEndCastMem
- set gHoldAtt to hMakeListFromCast(vEncyBeginCastMem, vEncyBeginCastMem)
- hMakeNewAttributes(gHoldAtt, vEncyBeginCastMem, pMode)
- end repeat
- repeat with vEpisBeginCastMem = vEpisBeginCastMem to vEpisEndCastMem
- set gHoldAtt to hMakeListFromCast(vEpisBeginCastMem, vEpisBeginCastMem)
- hMakeNewAttributes(gHoldAtt, vEpisBeginCastMem, pMode)
- end repeat
- repeat with vChroBeginCastMem = vChroBeginCastMem to vChroEndCastMem
- set gHoldAtt to hMakeListFromCast(vChroBeginCastMem, vChroBeginCastMem)
- hMakeNewAttributes(gHoldAtt, vChroBeginCastMem, pMode)
- end repeat
- end
-
- on hAddVideoToAttrib pBegin, pend
- hputmsg("hfindNameAddtoList BEGINS >")
- set vBeginShortCastMem to the number of cast "LU_A_ENCY"
- set vEndShortCastMem to the number of cast "LU_Z_ENCY"
- set vShortNameList to hMakeListFromCast(vBeginShortCastMem, vEndShortCastMem)
- set vShortNameList to value(vShortNameList)
- repeat with vcastNum = pBegin to pend
- set gHoldList to [:]
- set vList to value(the text of cast vcastNum)
- repeat with x = 1 to count(value(vList))
- set vHoldValue to getAt(vList, x)
- set vHoldProp to getPropAt(vList, x)
- set vHoldLong to vHoldProp & " (TNG)"
- set vHoldshortPos to getPos(vShortNameList, vHoldLong)
- set vHoldshortName to getPropAt(vShortNameList, vHoldshortPos)
- setAt(vHoldValue, 5, vHoldshortName)
- addProp(gHoldList, vHoldProp, vHoldValue)
- end repeat
- set the text of cast vcastNum to string(gHoldList)
- hputmsg("hAddVideoToAttrib > just wrote to castnumber" && vcastNum)
- end repeat
- end
-
- on hConcatenateLists aList, aNotherList
- put "Starting with" && aList && aNotherList
- set k to count(aNotherList)
- if aList = 0 then
- set aList to []
- end if
- repeat with n = 1 to k
- append(aList, getAt(aNotherList, n))
- end repeat
- return aList
- end
-
- on hMakeNewAttributes pList, pCastNum, pMode
- hputmsg(">hMakeNewAttributes for pCastNum" && pCastNum)
- set vHoldValue to []
- set gNewAttList to [:]
- set vNewValue to []
- set vMaxPicons to count(gPiconList)
- repeat with p = 1 to count(pList)
- set vHoldValue to getAt(pList, p)
- set vHoldProp to getPropAt(pList, p)
- if pMode = #Renew then
- put "You chose the RENEW option."
- put "Please note that IT, uh, HAS NEVER BEEN TESTED. Check your results carefully."
- set vHoldNumberPicons to 0
- set vNewPiconValueList to 0
- setAt(vHoldValue, 2, vHoldNumberPicons)
- setAt(vHoldValue, 3, vNewPiconValueList)
- else
- if pMode = #add then
- nothing()
- else
- beep()
- hputmsg(">hMakeNewAttributes is confused.")
- abort()
- end if
- end if
- set vIsItThere to getaProp(gPiconList, vHoldProp)
- set vNewPiconValueList to []
- if not voidp(vIsItThere) then
- hputmsg("...checking for picons in" && vHoldProp)
- set vthisPos to getPos(gPiconList, vIsItThere)
- set vCheckProp to getPropAt(gPiconList, vthisPos)
- add(vNewPiconValueList, vIsItThere)
- set vHoldNumberPicons to count(vNewPiconValueList)
- hputmsg("vHoldValue" && vHoldValue)
- if pMode = #add then
- setAt(vHoldValue, 2, getAt(vHoldValue, 2) + vHoldNumberPicons)
- else
- setAt(vHoldValue, 2, vHoldNumberPicons)
- end if
- hputmsg("vHoldNumberPicons is now" && vHoldNumberPicons)
- if pMode = #add then
- setAt(vHoldValue, 3, hConcatenateLists(getAt(vHoldValue, 3), vNewPiconValueList))
- else
- setAt(vHoldValue, 3, vNewPiconValueList)
- end if
- hputmsg("vHoldValue is now" && vHoldValue)
- set vthisPos to vthisPos + 1
- if vthisPos > vMaxPicons then
- set vCheckProp to "NOWAY"
- else
- set vCheckProp to getPropAt(gPiconList, vthisPos)
- end if
- end if
- repeat with xxx = 1 to 4
- if string(vCheckProp) = string(vHoldProp) then
- set vIsItThere to getAt(gPiconList, vthisPos)
- add(vNewPiconValueList, vIsItThere)
- set vHoldNumberPicons to count(vNewPiconValueList)
- setAt(vHoldValue, 2, vHoldNumberPicons)
- setAt(vHoldValue, 3, vNewPiconValueList)
- sort(vNewPiconValueList)
- set vthisPos to vthisPos + 1
- if vthisPos > vMaxPicons then
- set vCheckProp to "NOWAY"
- next repeat
- end if
- set vCheckProp to getPropAt(gPiconList, vthisPos)
- end if
- end repeat
- hputmsg("vHoldValue after last check=" && vHoldValue)
- addProp(gNewAttList, vHoldProp, vHoldValue)
- set vNewPiconValueList to []
- end repeat
- set the text of cast pCastNum to string(gNewAttList)
- hputmsg("hMakeNewAttributes wrote to cast number " && pCastNum)
- end
-
- on hMakePiconList pBegin, pend
- hputmsg(">hMakePiconList begins...")
- set gPiconList to [:]
- repeat with vCountCastMem = pBegin to pend
- set vHoldProp to the number of cast vCountCastMem
- set vHoldValue to the name of cast vCountCastMem
- set vHoldValue to chars(vHoldValue, 1, 6)
- hputmsg("...cast num" && vHoldProp)
- set vHoldValue to getProp(gHoldList, vHoldValue)
- addProp(gPiconList, vHoldValue, vHoldProp)
- end repeat
- hputmsg("...sorting the currentPicon List Now")
- sort(gPiconList)
- hputmsg("...done.")
- return gPiconList
- end
-
- on hThisIsAnEpisGuide pList
- set gHoldList to [:]
- hputmsg("hThisIsAnEpisGuide BEGINS > edit out the (TNG) or (TOS)")
- repeat with x = 1 to count(value(pList))
- set vHoldValue to getAt(pList, x)
- set vHoldProp to getPropAt(pList, x)
- set vHoldProp to char 1 to the number of chars in vHoldProp - 6 of vHoldProp
- addProp(gHoldList, vHoldProp, vHoldValue)
- end repeat
- hputmsg("hthisisanepisguide gHoldList" && gHoldList)
- return gHoldList
- end
-
- on hThisIsAnEpisGuideVal pList
- set gHoldList to [:]
- hputmsg("hThisIsAnEpisGuideVal BEGINS > edit out the (TNG) or (TOS)")
- repeat with x = 1 to count(value(pList))
- set vHoldValue to getAt(pList, x)
- set vHoldValue to char 1 to the number of chars in vHoldValue - 6 of vHoldValue
- set vHoldProp to getPropAt(pList, x)
- addProp(gHoldList, vHoldProp, vHoldValue)
- end repeat
- return gHoldList
- end
-
- on hUpdateLUtables pList, pTheString, PWriteCastMem
- set gHoldList to [:]
- set pList to value(pList)
- hputmsg("hUpdateLUtables BEGINS > edit out the (TNG) or (TOS)")
- repeat with x = 1 to count(value(pList))
- set vHoldValue to getAt(pList, x)
- set vHoldProp to getPropAt(pList, x)
- set vCountChar to the number of chars in vHoldValue
- set vEpisString to char vCountChar - 4 to vCountChar of vHoldValue
- set vHoldValue to char 1 to vCountChar - 6 of vHoldValue
- if vEpisString = pTheString then
- hputmsg("•••••" && vEpisString)
- addProp(gHoldList, vHoldProp, vHoldValue)
- end if
- end repeat
- set the text of cast PWriteCastMem to string(gHoldList)
- return gHoldList
- end
-
- on hMakeListFromCast pBegin, pend
- set vCurrentList to [:]
- set gHoldList to [:]
- set vtempList to [:]
- repeat with vCountCastMem = pBegin to pend
- set vCurrentList to the text of cast vCountCastMem
- set vCurrentList to value(vCurrentList)
- repeat with p = 1 to count(vCurrentList)
- set vHoldValue to getAt(vCurrentList, p)
- set vHoldProp to getPropAt(vCurrentList, p)
- addProp(gHoldList, vHoldProp, vHoldValue)
- end repeat
- end repeat
- hputmsg("hMakeListFromCast: Sorting this current attributes list" && pBegin)
- return gHoldList
- end
-
- on hAddPiconsToEpissub
- set vFixthese to []
- set vOldList to [:]
- set vStartEpisATT to the number of cast "ATTRIB_A_EPIS"
- set vEndEpisATT to the number of cast "ATTRIB_Z_EPIS"
- set vStartSubATT to the number of cast "ATTRIB_1_EPISSUB"
- set vEndSubATT to the number of cast "ATTRIB_5_EPISSUB"
- repeat with x = vStartEpisATT to vEndEpisATT
- set vHoldAttList to value(the text of cast x)
- repeat with p = 1 to count(vHoldAttList)
- set vHoldval to getAt(vHoldAttList, p)
- set vHoldProp to getPropAt(vHoldAttList, p)
- addProp(vOldList, vHoldProp, vHoldval)
- end repeat
- end repeat
- repeat with y = vStartSubATT to vStartSubATT + 2
- set vthisListVal to []
- set vNewSUBlist to [:]
- set vHoldthisSubList to value(the text of cast y)
- repeat with z = 1 to count(vHoldthisSubList)
- set vEntryName to getPropAt(vHoldthisSubList, z)
- set vHoldval to getAt(vHoldthisSubList, z)
- set vHoldEntryName to word 2 to the number of words in vEntryName of vEntryName
- set vTestHere to getaProp(vOldList, vHoldEntryName)
- if voidp(vTestHere) then
- set vHoldEntryName to hChangeTheA(vHoldEntryName)
- end if
- set vthisListVal to value(getaProp(vOldList, vHoldEntryName))
- set vthisListVal to value(vthisListVal)
- if not voidp(vthisListVal) then
- if getAt(vthisListVal, 2) <> 0 then
- set vNumofPicons to getAt(vthisListVal, 2)
- set vListofPicons to getAt(vthisListVal, 3)
- setAt(vHoldval, 2, vNumofPicons)
- setAt(vHoldval, 3, vListofPicons)
- end if
- else
- append(vFixthese, vHoldEntryName)
- hputmsg(" ADDED to list" && vHoldEntryName)
- end if
- addProp(vNewSUBlist, vEntryName, vHoldval)
- end repeat
- set the text of cast y to string(vNewSUBlist)
- end repeat
- repeat with y = vStartSubATT + 3 to vStartSubATT + 4
- set vthisListVal to []
- set vNewSUBlist to [:]
- set vHoldthisSubList to value(the text of cast y)
- repeat with z = 1 to count(vHoldthisSubList)
- set vEntryName to getPropAt(vHoldthisSubList, z)
- set vHoldval to getAt(vHoldthisSubList, z)
- set vHoldEntryName to vEntryName
- set vTestHere to getaProp(vOldList, vHoldEntryName)
- if voidp(vTestHere) then
- set vHoldEntryName to word 2 to the number of words in vEntryName of vEntryName
- set vHoldEntryName to hChangeTheA(vHoldEntryName)
- end if
- set vthisListVal to value(getaProp(vOldList, vHoldEntryName))
- set vthisListVal to value(vthisListVal)
- if not voidp(vthisListVal) then
- if getAt(vthisListVal, 2) <> 0 then
- set vNumofPicons to getAt(vthisListVal, 2)
- set vListofPicons to getAt(vthisListVal, 3)
- setAt(vHoldval, 2, vNumofPicons)
- setAt(vHoldval, 3, vListofPicons)
- end if
- else
- append(vFixthese, vHoldEntryName)
- end if
- addProp(vNewSUBlist, vEntryName, vHoldval)
- end repeat
- set the text of cast y to string(vNewSUBlist)
- end repeat
- put "*** Sorry, these must be done by hand ***"
- put vFixthese
- end
-
- on hAddAttToEpissubForEpisodeGuides
- set vFixthese to []
- set vOldList to [:]
- set vStartEpisATT to the number of cast "ATTRIB_A_EPIS"
- set vEndEpisATT to the number of cast "ATTRIB_Z_EPIS"
- set vSubATT to the number of cast "ATTRIB_2_EPISSUB"
- repeat with x = vStartEpisATT to vEndEpisATT
- set vHoldAttList to value(the text of cast x)
- repeat with p = 1 to count(vHoldAttList)
- set vHoldval to getAt(vHoldAttList, p)
- set vHoldProp to getPropAt(vHoldAttList, p)
- addProp(vOldList, vHoldProp, vHoldval)
- end repeat
- end repeat
- repeat with y = vSubATT to vSubATT
- set vthisListVal to []
- set vNewSUBlist to [:]
- set vHoldthisSubList to value(the text of cast y)
- repeat with z = 1 to count(vHoldthisSubList)
- set vEntryName to getPropAt(vHoldthisSubList, z)
- set vHoldval to getAt(vHoldthisSubList, z)
- set vHoldEntryName to word 2 to the number of words in vEntryName of vEntryName
- set vthisListVal to value(getaProp(vOldList, vHoldEntryName))
- set vthisListVal to value(vthisListVal)
- if not voidp(vthisListVal) then
- set vNumofPicons to getAt(vthisListVal, 2)
- set vListofPicons to getAt(vthisListVal, 3)
- setAt(vHoldval, 2, vNumofPicons)
- setAt(vHoldval, 3, vListofPicons)
- hputmsg("working on" && z)
- set vTextCastNum to getAt(vthisListVal, 9)
- set vTextItemNum to getAt(vthisListVal, 10)
- setAt(vHoldval, 9, vTextCastNum)
- setAt(vHoldval, 10, vTextItemNum)
- set vVideoRef to getAt(vthisListVal, 5)
- setAt(vHoldval, 5, vVideoRef)
- else
- append(vFixthese, vHoldEntryName)
- end if
- addProp(vNewSUBlist, vEntryName, vHoldval)
- end repeat
- set the text of cast y to string(vNewSUBlist)
- end repeat
- end
-
- on hChangeTheA pThisEntry
- if word 1 of pThisEntry = "Star" then
- set pThisEntry to " " & pThisEntry
- end if
- if word 1 of pThisEntry = "“A" then
- set vFirst to "“" & word 2 to the number of words in pThisEntry - 2 of pThisEntry
- set vTNGTOS to word the number of words in pThisEntry of pThisEntry
- set vwithQuote to word the number of words in pThisEntry - 1 of pThisEntry
- set vwithOutQuoate to char 1 to the number of chars in vwithQuote - 1 of vwithQuote
- if the number of words in pThisEntry > 3 then
- set pThisEntry to vFirst && vwithOutQuoate & ", A”" && vTNGTOS
- else
- set pThisEntry to "“" & vwithOutQuoate & ", A”" && vTNGTOS
- end if
- end if
- if word 1 of pThisEntry = "“The" then
- set vFirst to "“" & word 2 to the number of words in pThisEntry - 2 of pThisEntry
- set vTNGTOS to word the number of words in pThisEntry of pThisEntry
- set vwithQuote to word the number of words in pThisEntry - 1 of pThisEntry
- set vwithOutQuoate to char 1 to the number of chars in vwithQuote - 1 of vwithQuote
- if the number of words in pThisEntry > 3 then
- set pThisEntry to vFirst && vwithOutQuoate & ", The”" && vTNGTOS
- else
- set pThisEntry to "“" & vwithOutQuoate & ", The”" && vTNGTOS
- end if
- end if
- return pThisEntry
- end
-